package alpaca.network;


/**
 * This class will hold an object and an enum explaining what the message is holding and why.
 * The class is supposed to be sent through the network(between server-client), "in-house" messages should be done in another class.
 *
 * Set fromConnectionId when the object is received to know where this object came from.
 */

public class NetworkMessage {

	public enum Type {
		LOGIN,
		LOGIN_SUCCESS,
		LOGIN_FAIL,
		MESSAGE,
		SEARCH_TERM,
		SEARCH_RESULTS,
		ADD_CONTACT,
		NEW_CONTACT_LIST,
		DISCONNECTED, 
		ASSIGN_TAG,
		STATUS_UPDATE,
		REMOVE_CONTACT,
	}
	
	private Object object;
	private Type type;
	private int fromConnectionId;
	
	@Deprecated
	public NetworkMessage() {

	}
	
	public NetworkMessage(Object obj, Type type) {
		this.object=obj;
		this.type=type;
	}

	public Object getObject() {
		return object;
	}

	public Type getType() {
		return type;
	}

	public int getFromConnectionId() {
		return fromConnectionId;
	}
	
	public void setFromConnectionId(int id) {
		fromConnectionId = id;
	}

}
